'use strict';

module.exports = app => {
  const { model } = app;
  const { UUID, STRING, INTEGER } = app.Sequelize;

  const Zan = model.define(
    'Zan',
    {
      id: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true,
      },
      type: {
        type: STRING(255),
        allowNull: false,
        comment: '0 主题点赞  1 评论点赞',
      },
      type_id: {
        type: UUID,
        allowNull: false,
        comment: '点赞类型  0 主题点赞  1 评论点赞',
      },
      user_id: {
        type: UUID,
        allowNull: false,
      },
      status: {
        type: INTEGER,
        allowNull: false,
        comment: '点赞状态  0 取消赞   1 有效赞',
      },
    },
    {
      tableName: 'cms_zan',
    }
  );

  Zan.associate = function() {

  };

  return Zan;
};
